/*
 * 企业信息
 */
import { postRequest, getRequest } from '/@/lib/axios';

export const enterpriseApi = {
  // 删除企业
  delete: (enterpriseId) => {
    return getRequest(`/sys/tenant/delete?id=${enterpriseId}`);
  },

  // 查询企业详情
  detail: (enterpriseId) => {
    return getRequest(`/sys/tenant/get/?id=${enterpriseId}`);
  },

  // 分页查询企业模块
  pageQuery: (param) => {
    return postRequest('/sys/tenant/searchPage', param);
  },

  //租户用户信息
  queryPageEmployeeList: (param) => {
    return postRequest('/sys/tenant/tenantUserPage', param);
  },

  // 编辑企业
  update: (param) => {
    return postRequest('/sys/tenant/save', param);
  },

  /**
   * 查询全量资源树
   */
  getResourceAllTree: () => {
    return getRequest(`/sys/tenant/getResourceAllTree`);
  },

   /**
   * @description: 获取租户关联资源
   * @param {number} tenantId
   * @return {*}
   */
   getHasResource: (tenantId) => {
    return getRequest(`/sys/tenant/getHasResource?tenantId=${tenantId}`);
  },
  /**
   * @description: 保存资源租户关联
   * @param {TeantUpdateDTO} data
   * @return {*}
   */
  saveMenuTenant: (data) => {
    return postRequest('/sys/tenant/saveMenuTenant', data);
  },
   /**
   * @description: 获取租户关联资源
   * @param {number} tenantId
   * @return {*}
   */
   startTenant: (tenantId) => {
    return getRequest(`/sys/tenant/startTenant?tenantId=${tenantId}`);
  },
};
